package com.wwj.server.notify.msg;

import com.google.gson.annotations.SerializedName;
import com.wwj.core.wawa.entity.Player;
import com.wwj.server.model.NetBaseMsg;
import com.wwj.server.notify.common.MsgConstants;

public class DanmuMsgAck extends NetBaseMsg {

    private String type = MsgConstants.DAN_MU_ACK;

    @SerializedName("room_id")
    private String roomId;

    @SerializedName("device_id")
    private String deviceId;

    private String message;

    @SerializedName("user_id")
    private String userId;

    private String nickname;

    @SerializedName("header_icon")
    private String headerIcon;

    private String result;

    public DanmuMsgAck() {
    }

    public DanmuMsgAck(UserJoinRoomMsg msg, Player player, String message, String result) {
        this.roomId = msg.getRoomId();
        this.deviceId = msg.getDeviceId();
        this.userId = player.getId().toString();
        this.nickname = player.getNickname();
        this.headerIcon = player.getHeaderIcon();
        this.message = message;
        this.result = result;
    }

    public DanmuMsgAck(UserLeaveRoomMsg msg, Player player, String message, String result) {
        this.roomId = msg.getRoomId();
        this.deviceId = msg.getDeviceId();
        this.userId = player.getId().toString();
        this.nickname = player.getNickname();
        this.headerIcon = player.getHeaderIcon();
        this.message = message;
        this.result = result;
    }

    public DanmuMsgAck(DanmuMsg msg, Player player, String result) {
        this.roomId = msg.getRoomId();
        this.deviceId = msg.getDeviceId();
        this.message = player.getNickname() + ":" + msg.getMessage();
        this.userId = player.getId().toString();
        this.nickname = player.getNickname();
        this.headerIcon = player.getHeaderIcon();
        this.result = result;
    }

    public DanmuMsgAck(DanmuMsg msg, String result) {
        this.roomId = msg.getRoomId();
        this.deviceId = msg.getDeviceId();
        this.message = msg.getMessage();
        this.result = result;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeaderIcon() {
        return headerIcon;
    }

    public void setHeaderIcon(String headerIcon) {
        this.headerIcon = headerIcon;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }
}
